<?php
require_once './library/config.php';
require_once 'home/functions.php';

$_SESSION['shop_return_url'] = $_SERVER['REQUEST_URI'];


$returnMode = (isset($_GET['rm']) && $_GET['rm'] != '') ? $_GET['rm'] : '';
$pview = (isset($_GET['view']) && $_GET['view'] != '') ? $_GET['view'] : '';
$pitem  = (isset($_GET['item']) && $_GET['item'] != '') ? $_GET['item'] : 0;
$pcat   = (isset($_GET['cat']) && $_GET['cat'] != '') ? $_GET['cat'] : '';
// for search only
$searchText   = (isset($_GET['sw']) && $_GET['sw'] != '') ? $_GET['sw'] : '';

$script    = array('articles_functions.js');
$mapCat = array('bb'=>'Bài báo', 'dt'=>'Đề tài Khoa học', 'ht'=>'Hội thảo');

if ($returnMode == '')
{
	require_once 'include/header.php';
}
?>

<script>
$(function() {
		//$("a[rel]").overlay({mask: '#000', effect: 'apple'});
});
</script>

<div class="apple_overlay" style="background-color:white;" id="custom2">
	
</div>

<?php if ($returnMode == '') { ?>

<div id="wrapper">
	<div id="header">
		<?php //require_once 'include/top.php'; ?>
		<?php 
			// -14/07/2011: Login-lsw
		;?>
		<div id="top_login">
			<ul>
				<li><a href="<?php echo WEB_ROOT; ?>admin"><strong>Quản trị website</strong></a></li>
				<li><strong>Người dùng:&nbsp;</strong><a href="#"><span>Admin</span></li>
				<li class="last_logut"><a href="#"><strong>Thoát</strong></a></li>
			</ul>
		</div>
	</div>
	<div id="menu" align="bottom">
		<ul>
			<li class="cat-item current-cat"><a title="" href="index.php">Trang Chủ</a></li>
			<li class="cat-item cat-item-1">
				<a title="" href="javascript:viewList('bb', '<?php echo $mapCat['bb']; ?>');"><?php echo $mapCat['bb']; ?></a>
				<?php $cat = 'bb'; 
					require 'home/menu_widget.php';
				?>
			</li>
			<li class="cat-item cat-item-2">
				<a title="" href="javascript:viewList('dt', '<?php echo $mapCat['dt']; ?>');"><?php echo $mapCat['dt']; ?></a>
				<?php $cat = 'dt'; 
					require 'home/menu_widget.php';
				?>				
			</li>
			<li class="cat-item cat-item-3">
				<a title="" href="javascript:viewList('ht', '<?php echo $mapCat['ht']; ?>');"><?php echo $mapCat['ht']; ?></a>
				<ul class="children" style="display: block; visibility: hidden; ">
					<li class="cat-item cat-item-1">
						<a title="" href="javascript:viewList('ht', 'Thông tin Hội thảo');">Thông tin Hội thảo</a>	
					</li>
					<li class="cat-item cat-item-1">
						<a title="" href="javascript:viewList('kyht', 'Kỷ yếu Hội thảo');">Kỷ yếu Hội thảo</a>	
					</li>
				</ul>
			</li>
			<li class="cat-item cat-item-4"><a title="" href="index.php?view=list&cat=tcnb">Tạp chí Nội bộ</a></li>
			<li class="cat-item cat-item-4"><a title="" href="index.php?view=list&cat=gttl">Giáo trình - Tài liệu</a></li>
			<li class="cat-item cat-item-4"><a title="" href="index.php?view=list&cat=hpsp">Họa phẩm - Sản phẩm</a></li>
			<li class="cat-item cat-item-4"><a title="" href="index.php?view=lh">Liên hệ</a></li>
		</ul>
		<form class="searchform" method="get" action="javascript:viewSearch();">
			<fieldset>
				<input type="text" value="<?php echo $searchText; ?>" id="searchText" name="searchText" class="searchfield"></input>
				<input type="submit" value="Tìm kiếm" class="searchbutton" ></input>
			</fieldset>
		</form>
	</div>
	
<?php } ?>	

	<?php if ($pview == 'detail') { ?>
		<div id="bigcolumn">
			<?php require_once 'home/main_detail.php'; ?>
		</div>
	<?php } else { ?>
		<div id="maincolumn">
		<?php
			switch ($pview) {
				case 'list' :
					require_once 'home/main_list.php';		
					//$pageTitle 	= 'Quản trị cơ sở dữ liệu KHCN - Xem tác giả';
					break;
				case 'search' :
					require_once 'home/main_search.php';
					break;
				default :
					require_once 'home/maincolumn.php'; 		
					//$pageTitle 	= 'Quản trị cơ sở dữ liệu KHCN - Xem tác giả';
					break;
			}
			
		 ?>
		</div>
	<?php }?>
	
<?php if ($returnMode == '') { ?>

	<div id="sidebar">
		<?php require_once 'include/rightNav.php'; ?>
	</div>	
	<div id="sidebar2">
		<?php require_once 'include/rightNav.php'; ?>
	</div>	
</div>
<div class="clear"></div>
<div id="footer">
<?php
require_once 'include/footer.php';
?>
</div>

<?php } ?>	